const koa = require('koa')
const koaStatic = require('koa-static')
const cors = require('koa2-cors')
const views = require('koa-views')

const app = new koa()

app.use(cors())
app.use(views(__dirname + '/views', {extension: 'jade'}))
app.use(koaStatic(__dirname + '/public'))

app.use(async (ctx, next) => {
  await next()
  await ctx.render('404')
})

app.listen(8801)
console.log('app is listening 8801...')